<!-- 分享朋友圈代码 -->
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">
    function WeChat(title,ShareLink,ShareImgUrl,desc,backUrl) {
        //微信配置
        wx.config({
            debug: false,
            appId: "{$signPackage['appId']}",                       //公众号的唯一标识
            timestamp: "{$signPackage['timestamp']}",               //生成签名的时间戳
            nonceStr: "{$signPackage['nonceStr']}",                 //生成签名的随机串
            signature: "{$signPackage['signature']}",               //签名
            jsApiList: [
                // 所有要调用的 API 都要加到这个列表中
                'checkJsApi',
                'onMenuShareTimeline',
                'onMenuShareAppMessage'
            ]
        });

        wx.ready(function () {
            //获取"分享到朋友圈"按钮点击状态及分享内容接口
            wx.onMenuShareTimeline({
                title: title,
                link: ShareLink,
                desc:desc,
                imgUrl: ShareImgUrl,
                trigger: function (res) {
                    //alert('用户点击分享到朋友圈');
                },
                success: function (res) {
                    alert('已分享');
                    // window.location.href = backUrl;

                },
                cancel: function (res) {
                    alert('已取消');
                },
                fail: function (res) {
                    alert(JSON.stringify(res));
                }
            });

            //获取"分享给朋友"按钮点击状态及自定义分享内容接口
            wx.onMenuShareAppMessage({
                title: title, // 分享标题
                desc: desc, // 分享描述
                link:ShareLink,
                imgUrl:ShareImgUrl, // 分享图标
                success: function () {
                    // alert('已分享');
                    // window.location.href=backUrl;
                },
                cancel: function () {
                    return false;
                }
            });
        });
    }
</script>
<script>
    WeChat('心之所向，破陈求之',window.location.href,'https://starstart.com/Extend/images/share-logo.png','西安回车网络科技有限公司以互联网思维改善传统的行业方式。',window.location.href);
</script>
